package day20171001;


import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;

public class JsoupTest {
    public static void main(String[] args) throws IOException {

        String url1 = "http://news.ycombinator.com/";
        String url2 = "http://www.qq.com/";

        //Document doc1 = Jsoup.connect(url1).get();
        Document doc2 = Jsoup.connect(url2).get();

        //System.out.println(doc1.select("a[href]").text());
        //System.out.println(doc1.select("[src]").text());
        //System.out.println(doc1.select("link[href]").text());

        //System.out.println(doc2.select("div.contentLeft").text());
        System.out.println(doc2.select("a[href]").text());
        System.out.println(doc2.select("a").first());
        System.out.println(doc2.attr("abs:href"));




    }
}
